{% extends 'dashboard/base.html' %}

{% block body %}

    {#<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>#}


    <div class="row">
        <div class="col-md-12">
            <div class="card">
                <div class="card-body">
                    <br>
                    {#                        <div class="float-right">#}
                    {#                            <form action="{% url 'dashboard:export' %}" method="post"#}
                    {#                                  class="forms-sample">#}
                    {#                                {% csrf_token %}#}
                    {#                                <div class="form-row align-items-center">#}
                    {#                                    <div class="col-auto my-1">#}
                    {#                                        <select name="type" class="custom-select mr-sm-2" id="inlineFormCustomSelect">#}
                    {#                                            <option value="csv" selected>CSV</option>#}
                    {#                                            <option value="json">JSON</option>#}
                    {#                                            <option value="yaml">YAML</option>#}
                    {#                                        </select>#}
                    {#                                    </div>#}
                    {#                                    <div class="col-auto my-1">#}
                    {#                                        <input type="hidden" name="project_id" value="{{project_id}}"/>#}
                    {#                                        <input type="hidden" name="severity" value="{{severity}}"/>#}
                    {#                                        <button type="submit" class="btn btn-primary"><i#}
                    {#                                                class="fas fa-arrow-alt-circle-down"></i></button>#}
                    {#                                    </div>#}
                    {#                                </div>#}
                    {#                            </form>#}
                    {#                        </div>#}
                    <div class="d-md-flex align-items-center">
                        <h1 class="card-title">{{ severity }} Vulnerability List</h1>
                    </div>
                    <br>
                    <br>
                    <div class="row">
                        <div class="table-responsive">
                            <table id="vuln_details" class="table table-striped table-bordered" width="100%">
                                <thead>
                                <tr>
                                    <th>Vulnerability</th>
                                    <th>Scanner</th>
                                    <th>URL/IP</th>
                                    <th>Risk</th>

                                </tr>
                                </thead>
                                <!--zap-->
                                <tbody>
                                <!-- add your scanner here  -->
                                {% for data in sast_all_high %}
                                    <tr data-target="#">

                                        <td>
                                            <a href="{% url 'staticscanners:list_vuln_info' %}?scan_id={{ data.scan_id }}&scan_name={{ data.title }}&scanner={{ data.scanner }}">{{ data.title }}</a>
                                        </td>
                                        <td>{% if data.scanner == 'Dependencycheck' %}

                                        <div class="p-1"><img src="/static/tools/dependencycheck.png" alt="user" width="30"
                                                                  class="rounded-circle" data-toggle="tooltip" data-placement="top" title="Dependencycheck"></div></td>{% elif data.scanner == 'Checkmarx' %}
                                     <div class="p-1"><img src="/static/tools/checkmarx.png" alt="user" width="30"
                                                                  class="rounded-circle" data-toggle="tooltip" data-placement="top" title="Checkmarx"></div></td>{% elif data.scanner == 'Findbugs' %}
                                     <div class="p-1"><img src="/static/tools/findbugs.png" alt="user" width="30"
                                                                  class="rounded-circle" data-toggle="tooltip" data-placement="top" title="Findbugs"></div></td>{% elif data.scanner == 'Bandit' %}
                                     <div class="p-1"><img src="/static/tools/bandit.jpeg" alt="user" width="30"
                                                                  class="rounded-circle" data-toggle="tooltip" data-placement="top" title="Bandit"></div></td>{% elif data.scanner == 'Clair' %}
                                     <div class="p-1"><img src="/static/tools/clair.svg" alt="user" width="30"
                                                                  class="rounded-circle" data-toggle="tooltip" data-placement="top" title="Clair"></div></td>{% elif data.scanner == 'Trivy' %}
                                     <div class="p-1"><img src="/static/tools/trivy.png" alt="user" width="30"
                                                                  class="rounded-circle" data-toggle="tooltip" data-placement="top" title="Trivy"></div></td>{% elif data.scanner == 'Npmaudit' %}
                                      <div class="p-1"><img src="/static/tools/npmaduit.png" alt="user" width="30"
                                                                  class="rounded-circle" data-toggle="tooltip" data-placement="top" title="Npmaudit"></div></td>{% elif data.scanner == 'Nodejsscan' %}
                                     <div class="p-1"><img src="/static/tools/nodejs.jpeg" alt="user" width="30"
                                                                  class="rounded-circle" data-toggle="tooltip" data-placement="top" title="Nodejsscan"></div></td>{% elif data.scanner == 'Tfsec' %}
                                     <div class="p-1"><img src="/static/tools/tfsec.png" alt="user" width="30"
                                                                  class="rounded-circle" data-toggle="tooltip" data-placement="top" title="Tfsec"></div></td>{% elif data.scanner == 'Whitesource' %}
                                     <div class="p-1"><img src="/static/tools/whitesource.png" alt="user" width="30"
                                                                  class="rounded-circle" data-toggle="tooltip" data-placement="top" title="Whitesource"></div></td>
                                 {% elif data.scanner == 'Twistlock' %}
                                     <div class="p-1"><img src="/static/tools/twistlock.png" alt="user" width="30"
                                                                 class="rounded-circle" data-toggle="tooltip" data-placement="top" title="Twistlock"></div></td>
                                     {% elif data.scanner == 'Semgrep' %}
                                     <div class="p-1"><img src="/static/tools/semgrep.svg" alt="user" width="30"
                                                                  class="rounded-circle" data-toggle="tooltip" data-placement="top" title="Semgrep"></div></td>
                                     {% elif data.scanner == 'Brakeman' %}
                                     <div class="p-1"><img src="/static/tools/brakeman.png" alt="user" width="30"
                                                                  class="rounded-circle" data-toggle="tooltip" data-placement="top" title="Brakeman"></div></td>
                                     {% elif data.scanner == 'Gitlabsca' %}
                                     <div class="p-1"><img src="/static/tools/gitlab.png" alt="user" width="30"
                                                                  class="rounded-circle" data-toggle="tooltip" data-placement="top" title="Gitlabsca"></div></td>
                                      {% elif data.scanner == 'Gitlabsast' %}
                                     <div class="p-1"><img src="/static/tools/gitlab.png" alt="user" width="30"
                                                                  class="rounded-circle" data-toggle="tooltip" data-placement="top" title="Gitlabsast"></div></td>
                                 {% endif %}
                                        <td>{{ data.fileName }}</td>
                                        <td><span
                                                class="badge badge-pill badge-{{ data.severity_color }}">{{ data.severity }}</span>
                                        </td>
                                    </tr>
                                {% endfor %}

                                {% for data in web_all_high %}
                                    <tr data-target="#">

                                        <td>
                                            <a href="{% url 'webscanners:list_vuln_info' %}?scan_id={{ data.scan_id }}&scan_name={{ data.title }}&scanner={{ data.scanner }}">{{ data.title }}</a>
                                        </td>
                                        <td>{% if data.scanner == 'Zap' %}

                                        <div class="p-1"><img src="/static/tools/zap.png" alt="user" width="20"
                                                                  class="rounded-circle" data-toggle="tooltip" data-placement="top" title="OWASP ZAP"></div></td>
                                        {% elif data.scanner == 'Burp' %}
                                        <div class="p-1"><img src="/static/tools/burp.png" alt="user" width="20"
                                                                  class="rounded-circle" data-toggle="tooltip" data-placement="top" title="Burp"></div></td>
                                        {% elif data.scanner == 'Arachni' %}
                                        <div class="p-1"><img src="/static/tools/arachni.png" alt="user" width="30"
                                                                  class="rounded-circle" data-toggle="tooltip" data-placement="top" title="Arachni"></div></td>
                                        {% elif data.scanner == 'Netsparker' %}
                                        <div class="p-1"><img src="/static/tools/netsparker.png" alt="user" width="30"
                                                                  class="rounded-circle" data-toggle="tooltip" data-placement="top" title="Netsparker"></div></td>
                                {% elif data.scanner == 'Webinspect' %}
                                        <div class="p-1"><img src="/static/tools/webinspect.png" alt="user" width="30"
                                                                  class="rounded-circle" data-toggle="tooltip" data-placement="top" title="Webinspect"></div></td>
                                        {% elif data.scanner == 'Acunetix' %}
                                        <div class="p-1"><img src="/static/tools/acunetix.png" alt="user" width="30"
                                                                  class="rounded-circle" data-toggle="tooltip" data-placement="top" title="Acunetix"></div></td>
                                        {% endif %}
                                        <td>{{ data.url }}</td>
                                        <td><span
                                                class="badge badge-pill badge-{{ data.severity_color }}">{{ data.severity }}</span>
                                        </td>
                                    </tr>
                                {% endfor %}


                                {% for data in net_all_high %}
                                    <tr data-target="#">

                                        <td>
                                            <a href="{% url 'networkscanners:list_vuln_info' %}?scan_id={{ data.scan_id }}&ip={{ data.ip }}&scanner={{ data.scanner }}">{{ data.title }}</a>
                                        </td>
                                        <td>{% if data.scanner == 'Nessus' %}

                                            <div class="p-1"><img src="/static/tools/nessus.png" alt="user" width="30"
                                                                  class="rounded-circle" data-toggle="tooltip"
                                                                  data-placement="top" title="Nessus"></div>
                                            </td>{% elif data.scanner == 'Openvas' %}
                                            <div class="p-1"><img src="/static/tools/openvas.png" alt="user" width="30"
                                                                  class="rounded-circle" data-toggle="tooltip"
                                                                  data-placement="top" title="Openvas"></div></td>
                                        {% endif %}
                                        <td>{{ data.ip }}</td>
                                        <td><span
                                                class="badge badge-pill badge-{{ data.severity_color }}">{{ data.severity }}</span>
                                        </td>
                                    </tr>
                                {% endfor %}

                                {% for data in pentest_all_high %}
                                    <tr data-target="#">

                                        <td>
                                            <a href="{% url 'pentest:vuln_details' %}?vuln_id={{ data.vuln_id }}">{{ data.vuln_name }}</a>
                                        </td>
                                        <td>Pentest</td>
                                        <td>{{ data.vuln_url }}</td>
                                        <td><span
                                                class="badge badge-pill badge-{{ data.severity_color }}">{{ data.severity }}</span>
                                        </td>
                                    </tr>
                                {% endfor %}
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

{% endblock %}